import java.util.concurrent.Semaphore;

/**
 * 
 * @author Eliran
 * @param name represents Ingredient's name
 * @param quantity represents the amount of Ingredients in the kitchen
 *
 * Ingredient class represents all Ingredient in the kitchen and theirs amount
 */
public class Ingredient {
	private String name;
//	private int quantity;
	private Semaphore sem;
	
	public Ingredient(String n, int q){
		name = n;
		quantity = q;
		sem = new Semaphore(q, true);  
	}
	
	/**
	 * 
	 * @return Ingredient's name
	 */
	public String getName() {
		return name;
	}
	
	/**
	 * 
	 * @return Ingredient's quantity
	 */
	
	public void acquire() {
		sem.acquire();
	}
	
}
